---
title: 概述
sidebar_position: 0
---

## 整体架构
<img src="https://wkq-img.oss-cn-chengdu.aliyuncs.com/20241215023239.png"/>

假设服务足够复杂，模块按部门来分，比如订单，会建立一个订单的模块组。
## 服务内架构
<img src="https://wkq-img.oss-cn-chengdu.aliyuncs.com/20241215024051.png"/>

日志收集，加上下面依赖，还需要配置 logback-spring.xml
<img src="https://wkq-img.oss-cn-chengdu.aliyuncs.com/20241215143943.png"/>
<img src="https://wkq-img.oss-cn-chengdu.aliyuncs.com/20241215150017.png"/>


## 如何快速开发？
1. Domain Service 层没有权限，基于领域建模，有一套脚手架,基础项目可以直接使用脚手架生成。

```text title='项目创建脚手架'
mvn archetype:generate -Dgroupld=com.only4play -Dartifactld=op-paycenter -Dversion=1.0.0-SNAPSHOT -Dpackage=com.only4play.paycenter -DarchetypeArtifactld=op-service-archetype -DarchetypeGroupld=com.only4play -DarchetypeVersion=1.0.0-SNAPSHOT -DappName=test
```
2. 使用 live template

## maven 环境配置
maven 当前仓库使用阿里免费的仓库进行发布，免去了自建 nexus 的麻烦。

```settings settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <mirror>
            <id>mirror</id>
            <mirrorOf>central,jcenter,!2256961-release-uvdbXC</mirrorOf>
            <name>mirror</name>
            <url>https://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror>
    </mirrors>
    <!-- 指定本地仓库的位置 -->
    <localRepository>C:\Users\21129\.m2\repository</localRepository>
    <servers>
        <server>
            <id>2256961-release-uvdbXC</id>
            <username>62dd566101acbf842af9fcd0</username>
            <password>a5EPh5YzMS6H</password>
        </server>
        <server>
            <id>2256961-snapshot-OgtSEM</id>
            <username>62dd566101acbf842af9fcd0</username>
            <password>a5EPh5YzMS6H</password>
        </server>
    </servers>
    <profiles>
        <profile>
            <id>rdc</id>
            <properties>

                <altReleaseDeploymentRepository>
                    2256961-release-uvdbXC::default::https://packages.aliyun.com/62dd566ede1705ebb4f3382f/maven/2256961-release-uvdbxc
                </altReleaseDeploymentRepository>
                <altSnapshotDeploymentRepository>
                    2256961-snapshot-OgtSEM::default::https://packages.aliyun.com/62dd566ede1705ebb4f3382f/maven/2256961-snapshot-ogtsem
                </altSnapshotDeploymentRepository>
            </properties>
            <repositories>
                <repository>
                    <id>central</id>
                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>snapshots</id>
                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>rdc-release</id>
                    <url>https://packages.aliyun.com/62dd566ede1705ebb4f3382f/maven/2256961-release-uvdbxc</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>rdc-snapshot</id>
                    <url>https://packages.aliyun.com/62dd566ede1705ebb4f3382f/maven/2256961-snapshot-ogtsem</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>snapshots</id>
                    <url>https://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>rdc-release</id>
                    <url>https://packages.aliyun.com/62dd566ede1705ebb4f3382f/maven/2256961-release-uvdbxc</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>rdc-snapshot</id>
                    <url>https://packages.aliyun.com/62dd566ede1705ebb4f3382f/maven/2256961-snapshot-ogtsem</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
        <profile>
            <id>edas.oss.repo</id>
            <repositories>
                <repository>
                    <id>edas-oss-central</id>
                    <name>taobao mirror central</name>
                    <url>http://edas-public.oss-cn-hangzhou.aliyuncs.com/repository</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>edas-oss-plugin-central</id>
                    <url>http://edas-public.oss-cn-hangzhou.aliyuncs.com/repository</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>rdc</activeProfile>
        <activeProfile>edas.oss.repo</activeProfile>
    </activeProfiles>
</settings>
```

## ssh 免密登录
把 ssh 公钥复制到云服务器下的 `/root/.ssh/` 目录下。


